package com.example.repository;

import com.example.entity.Article;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

public interface ArticleRepository extends JpaRepository<Article, Integer> {

    @Query(value = "UPDATE t_article set content=?2 where id=?1", nativeQuery = true)
    @Modifying
    @Transactional
    public int updateArticle(Integer Id, String content);
}
